function popupPublishTargetInfoEMDetails(docID, ms_num, sPage, ePage, numPages, tocPos) { var okAction = function () { var name = "med_publish_info.asp?docID=" + docID + "&ms_num=" + ms_num + "&sPage=" + sPage + "&ePage=" + ePage + "&numPages=" + numPages + "&tocPos=" + tocPos; openCenterWin(name,"publish_information",1,1,0,0,0,0); }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } function popupReviewerInfoEMDetails(peopleID, docID, jrnlID, formHasChanged) { if (formHasChanged == 1) { var okAction = function () { var url = "reviewer_info.asp?rv=R"; url += "&id=" + peopleID; url += "&detail=1"; url += "&docid=" + docID; if (typeof(jrnlID) != "undefined") url += "&jrnlID=" + jrnlID; openCenterWin2(url,"popupReviewerInfo",750, 500, 1,1,0,0,0,0) }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } else { var url = "reviewer_info.asp?rv=R"; url += "&id=" + peopleID; url += "&detail=1"; url += "&docid=" + docID; if (typeof(jrnlID) != "undefined") url += "&jrnlID=" + jrnlID; openCenterWin2(url,"popupReviewerInfo",750, 500, 1,1,0,0,0,0) } } function popupPublishInfoEMDetails(docID, ms_num) { var okAction = function () { var name = "med_publish_info.asp?docID=" + docID + "&ms_num=" + ms_num; openCenterWin(name,"publish_information",1,1,0,0,0,0); }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } function popupBlindedEditorsEMDetails(docID) { var okAction = function () { var name = "assignBlindedEditors.aspx?docID=" + docID; openCenterWin(name,"blinded_editors",1,1,0,0,0,0); }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } function showAdditionalManuscriptDetailsEMDetails(documentID) { var okAction = function () { var name = 'addtnlManuscriptDetails.aspx?documentID=' + documentID; var aNewWindow = window.open(name, "unavailable", "resizable=yes,scrollbars=yes,height=500,width=725"); aNewWindow.focus(); }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } function viewTransmittalFormEMDetails(docID, msid, revision, ms_num) { var okAction = function () { var name = ""; name += "transmittalForm.asp?docid=" + docID + "&msid=" + msid + "&rev=" + revision + "&ms_num=" + ms_num; name += "&isPopUpTransmittalForm=True"; openCenterWin(name,"transmittalForm",1,1,0,0,0,0); }; $("#warningDialog")[0].showDialog('You are navigating to a new page\x3b changes you have made to data on the main Details page may be lost. On returning to this page, fields that also appear on the new page will not reflect any changes made on the new page until you refresh or reload the page.\n\nClick Cancel to return to the details page and save your changes.\nClick OK to continue to the new page without saving changes. ', okAction); } function verifyEmailAddr(addr) { if (addr.length > 0) { if(addr.indexOf(";",addr.count-1)>0) { addr += ";"; } var addrs= addr.split(";"); for (i = 0; i < addrs.length; ++i) { if (addrs[i].length ==0) {continue;} addr=addrs[i]; // there must be one and only one at sign var atSign = addr.indexOf("@", 0); if (atSign == -1) { alert("E-mail address must contain an \x40 sign."); return false; } if ( (atSign+1 >= addr.length) || (addr.charAt(atSign+1) == '.') ) { alert("Domain name is missing in the e-mail address."); return false; } // if here, there is an '@'. There must not be another one. if (addr.indexOf("@", atSign + 1) != -1) { alert("E-mail address must contain only one \x40 sign."); return false; } if (atSign == 0) { alert("Invalid E-mail address."); return false; } // get the domain name and verify it var errorMessage = "Invalid E-mail address."; if(!/^[-A-Z0-9!#$%&'*+/=?^_'{|}~]+[-A-Z0-9!#$%&'*+/=?^_'{|}~.]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,6}$/i.test(addr)) { alert(errorMessage); return false; } } } return true; } function validateDates(theForm) { for (var i=0; i < theForm.elements.length; i++) { if (theForm.elements[i].name.indexOf("range") > -1) { if (theForm.elements[i].checked) { if (theForm.elements[i].value == "specific") { if(theForm.elements["startDate"].value == "") { alert("Please enter a Start Date."); break; } if(theForm.elements["endDate"].value == "") { alert("Please enter an End Date."); break; } var startValid = convert_date(theForm.startDate); var endValid = convert_date(theForm.endDate); if (startValid && endValid) { start = new Date(theForm.startDate.value); end = new Date(theForm.endDate.value); today = new Date(); if (isNaN(start)) alert("Please enter a valid Start Date in the format mm\x2fdd\x2fyyyy."); else if (isNaN(end)) alert("Please enter a valid End Date in the format mm\x2fdd\x2fyyyy."); else if (end < start) alert("Please enter an End Date that is later than the Start Date."); else if (start > today) alert("Please enter a Start Date that is no later than today\x27s date"); else theForm.submit(); } } else { // get the current date var curdate = new Date(); var curYear = curdate.getFullYear(); var curMonth = curdate.getMonth(); if (theForm.elements[i].value == "curmonth") { theForm.startDate.value = "" + (curMonth + 1) + "/1/" + curYear; theForm.endDate.value = "" + (curMonth + 1) + "/" + curdate.getDate() + "/" + curYear; theForm.submit(); } else if (theForm.elements[i].value == "curyear") { theForm.startDate.value = "1/1/" + curYear; theForm.endDate.value = "" + (curMonth + 1) + "/" + curdate.getDate() + "/" + curYear; theForm.submit(); } else if (theForm.elements[i].value == "lastyear") { theForm.startDate.value = "1/1/" + (curYear - 1); theForm.endDate.value = "12/31/" + (curYear - 1); theForm.submit(); } else if (theForm.elements[i].value == "lastmonth") { // It's January, so set the dates for December of the prior year if (curMonth == 0) { theForm.startDate.value = "12/1/" + (curYear - 1); theForm.endDate.value = "12/31/" + (curYear - 1); } else { theForm.startDate.value = "" + curMonth + "/1/" + curYear; // But what's the last day of the month? // 30 days has September, April, June, and November switch (curMonth) { case 4: // April case 6: // June case 9: // September case 11: // November theForm.endDate.value = "" + curMonth + "/30/" + curYear; break; case 2: // February // is it a leap year? leaptest = "" + ((curYear)/4); if (leaptest.indexOf(".") == -1) // it is theForm.endDate.value = "" + curMonth + "/29/" + curYear; else theForm.endDate.value = "" + curMonth + "/28/" + curYear; break; default: theForm.endDate.value = "" + curMonth + "/31/" + curYear; break; } } theForm.submit(); } } break; } } } } function warnEditorOfTechComments(link) { var warningStr = "Warning\x3a There are comments in the \x27Technical Comments to Author box. When an Editor is assigned, these comments will be deleted. Click \x27Cancel\x27 in this dialog box to examine these comments, or \x27OK\x27 to proceed and allow the comments to be removed by the system.\x0a"; if (window.confirm(warningStr)) document.location.href = link; } function editorAssignment(documentID, warnOfTechnicalComments, useReassignEditorChain, buildEditorChain, enableSuggestEditorSearch, enableEditorSearch , sessionThreadId) { var url, warningStr = "Warning\x3a There are comments in the \x27Technical Comments to Author box. When an Editor is assigned, these comments will be deleted. Click \x27Cancel\x27 in this dialog box to examine these comments, or \x27OK\x27 to proceed and allow the comments to be removed by the system.\x0a"; if (!warnOfTechnicalComments || window.confirm(warningStr)) { if(useReassignEditorChain) { url = "reassignPreviousEditors.aspx?selectType=1&docId=" + documentID + "&SessionThreadIdField=" + sessionThreadId; } else if(!useReassignEditorChain && buildEditorChain){ url = "AssignEditorChain.aspx?docId=" + documentID + "&SessionThreadIdField=" + sessionThreadId; } else if(!useReassignEditorChain && !buildEditorChain && enableSuggestEditorSearch){ url = "suggestEditor.aspx?selectType=1&documentID=" + documentID + "&assignEditorLink=true&SessionThreadIdField=" + sessionThreadId; } else if(!useReassignEditorChain && !buildEditorChain && !enableSuggestEditorSearch && enableEditorSearch){ url = "selectEditor.aspx?selectType=1&documentID=" + documentID + "&SessionThreadIdField=" + sessionThreadId; } else { url = "selectEditor2.aspx?selectType=1&documentID=" + documentID + "&SessionThreadIdField=" + sessionThreadId; } openCenterWinPct(url,"editorAssignment",1,1,0,0,0,0,750, 500, 0.90); } } function warnEditorOfSubmissionRemoval(link, inLinkedGroup) { var msg = ""; if (inLinkedGroup) { msg = "This submission belongs to a Linked Submission Group. Removing the submission will remove it from this group and clear the Publish With ID \x28if assigned\x29. Are you sure you want to remove this submission\x3f\x0a"; } else { msg = "Are you sure you want to remove this submission\x3f\x0a"; } if (window.confirm(msg)) document.location.href = link; } function submissionRemovalWarning(link, inLinkedGroup) { var msg = ""; if (inLinkedGroup) { msg = "This submission belongs to a Linked Submission Group. Removing the submission will remove it from this group and clear the Publish With ID \x28if assigned\x29. Are you sure you want to remove this submission\x3f\x0a"; } else { msg = "Are you sure you want to remove this submission\x3f\x0a"; } var okAction = function() { document.location.href = link; }; $("#warningDialog")[0].showDialog(msg, okAction); } function warnEditorOfSubmissionApproval(link, viewed) { if (!viewed) { alert("You must View the submission PDF for accuracy and completeness before taking additional action. Please click View Submission, and when you are satisfied with the PDF, click Approve Submission to send back to the folder it was in before you chose to Edit the Submission, or click Send to Author if you would also like the Author\x27s approval. If there are minor changes you would like to make, click Edit Submission. If there is an error with the submission PDF \x28e.g., PDF build error, loss of data, corrupt files\x29, click Revert Submission to revert to the previous version of the PDF.\n\nWARNING\x21 If you do find an error in the PDF that you have built, it is best to Revert Submission BEFORE you Edit Submission.\x0a\x0a"); } else { if (window.confirm("Are you sure you want to approve this submission\x3f")) document.location.href = link; } } function submissionApprovalWarning(link, viewed) { if (!viewed) { window.clearTimeout(timerID); $("#errorDialog")[0].showDialog("You must View the submission PDF for accuracy and completeness before taking additional action. Please click View Submission, and when you are satisfied with the PDF, click Approve Submission to send back to the folder it was in before you chose to Edit the Submission, or click Send to Author if you would also like the Author\x27s approval. If there are minor changes you would like to make, click Edit Submission. If there is an error with the submission PDF \x28e.g., PDF build error, loss of data, corrupt files\x29, click Revert Submission to revert to the previous version of the PDF.\n\nWARNING\x21 If you do find an error in the PDF that you have built, it is best to Revert Submission BEFORE you Edit Submission.\x0a\x0a"); } else { var okAction = function () { document.location.href = link; }; var cancelAction = function () { resetTimeout(); }; window.clearTimeout(timerID); $("#warningDialog")[0].showDialog("Are you sure you want to approve this submission\x3f", okAction, cancelAction); } } function warnEditorOfSubmissionReversion(link) { if (window.confirm('Are you sure you want to Revert this Submission\x3f\x0a\x0aReverting will abandon any changes that have been made, and will Revert the submission to the version that the Author submitted. After you \x22Revert\x22, the Submission ceases to be available in this folder.\x0a')) document.location.href = link; } function checkLinkState(link) { if (link.disabled == true) { alert("Processing Information...\n\nPlease allow system to finish before navigating away from this page."); return false; } else return true; } function verifyEmailAddrReturnMessage(addr) { var errorMsg = 'E-mail address is missing.'; if (addr.length == 0) { return errorMsg } if( addr.indexOf(";", addr.count-1) > 0 ) { addr += ";"; } // Get an array of email addresses var addrs= addr.split(";"); errorMsg = ""; for (i = 0; i < addrs.length; ++i) { if (addrs[i].length ==0) {continue;} addr=addrs[i]; // there must be one and only one at sign var atSign = addr.indexOf("@", 0); if (atSign == -1) { errorMsg = "E-mail address must contain an \x40 sign."; break; } if( (atSign+1 >= addr.length) || (addr.charAt(atSign+1) == '.')) { errorMsg = "Domain name is missing in the e-mail address."; break; } // if here, there is an '@'. There must not be another one. if (addr.indexOf("@", atSign + 1) != -1) { errorMsg = "E-mail address must contain only one \x40 sign."; break; } if (atSign == 0) { errorMsg = "Invalid E-mail address."; break; } if(!/^[-A-Z0-9!#$%&'*+/=?^_'{|}~]+[-A-Z0-9!#$%&'*+/=?^_'{|}~.]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,100}$/i.test(addr)) { errorMsg = "Invalid E-mail address."; break; } } return errorMsg; } function processLetterBody(textFieldId) { var strTagsAreNotAllowed = '{0} tags are not allowed in letters.'; return processCkEditorBody(textFieldId, strTagsAreNotAllowed, '') } function processCkEditorBody(textFieldId, strTagsAreNotAllowed, fieldString) { var bodyText; var isRichTextMode = false; if (typeof CKEDITOR !== 'undefined' && CKEDITOR.instances[textFieldId]) { bodyText = CKEDITOR.instances[textFieldId].getData(); isRichTextMode = true; } else { bodyText = $('#' + textFieldId).val(); } if (bodyText.length == 0) { return { letterBody: bodyText, scrptTag: null }; } var scrptTagName = unauthorizedHTMLCheck(bodyText); var scriptTagsFound = (scrptTagName.length > 0); if (!scriptTagsFound && isRichTextMode) { $.each($.parseHTML(bodyText),function(index, val) { if (scriptTagsFound) { return; } scrptTagName = unauthorizedHTMLCheck($(val).text()); scriptTagsFound = scriptTagsFound || (scrptTagName.length > 0); }); } var errorMessage = null; if (scriptTagsFound) { if (fieldString === '') { errorMessage = FormatString(strTagsAreNotAllowed, [scrptTagName]); } else { errorMessage = FormatString(strTagsAreNotAllowed, [scrptTagName, fieldString]); } } return { letterBody: bodyText, error: errorMessage }; } function clearLetterBody(textFieldId) { if (typeof CKEDITOR !== 'undefined' && CKEDITOR.instances[textFieldId]) { CKEDITOR.instances[textFieldId].setData(''); } else { $('#' + textFieldId).val(''); } } function addFormatting(letterSubjectId, letterBodyId, includeCustomMergeCode, includeAmdMergeCode, linksCellId, updateLetterFormat, customAlert) { var strTagsAreNotAllowedInLetters = '{0} tags are not allowed in letters.'; var $letterBody = $('#' + letterBodyId); var bodyText = $letterBody.val(); var scrptTagName = unauthorizedHTMLCheck(bodyText); if (scrptTagName) { var errorMessage = FormatString(strTagsAreNotAllowedInLetters, [scrptTagName]); if ($.isFunction(customAlert)) { customAlert(errorMessage); } else { alert(errorMessage); } return; } $($letterBody).val(bodyText.replace(/(?:\r\n|\r|\n)/g, '
')); InitializeCKEditorToolbars('#' + letterSubjectId, [letterBodyId], includeCustomMergeCode, includeAmdMergeCode, false, false,'#' + linksCellId); if ($.isFunction(updateLetterFormat)) { updateLetterFormat(); } } function showMessage(msg) { var $dialog = jQuery("#pageDialog"); $dialog.dialog({ buttons: { 'OK': function(){ jQuery(this).dialog("close"); } }, autoOpen: false, height: 'auto', modal: true, draggable: false, resizeable: false, closeText: 'hide', dialogClass: "messageDialog no-close", title: '', }); $dialog.html(msg); $dialog.dialog('open'); } function showErrorMessage(msg) { var $dialog = jQuery("#pageDialog"); $dialog.dialog({ buttons: { 'OK': function() { jQuery(this).dialog("close"); } }, autoOpen: false, height: 'auto', modal: true, draggable: false, resizeable: false, closeText: 'hide', dialogClass: "errorDialog no-close", title: 'Error' }); jQuery("#pageDialog")[0].innerHTML = "
" + msg + "
"; $dialog.dialog('open'); } function SubmitEarlyDecisionNewSubmissions(docID,msid) { var url = 'SubmitEarlyDecisionNewSubmission.aspx?documentID=' + docID + "&msid=" + msid; openCenterWin75Percent(url, 'SubmitEarlyDecision', 1, 1, 0, 0, 0, 0); } function BlockUI() { $.blockUI2('spinnerOverlayWithMessage', 'Loading...'); } function UnBlockUI() { $.unblockUI2(); }